<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>首页</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #header {
            width: 100%;
            height: 50px;
            background: #2E363F;
        }

        #content {
            width: 100%;
            height: 500px;
            background: #ccc;
        }

        #menu {
            width: 20%;
            height: 100%;
            background: #939da8;
            float: left;
        }

        #list {
            width: 80%;
            height: 100%;
            /* background: pink; */
            float: left;
            padding-top: 50px;
        }
    </style>
</head>

<body>
    <div id="main">
        <div id="header"></div>
        <div id="content">
            <div id="menu">
                <h1>用户管理</h1>
                <ul>
                    <li data-path="users_list.html">用户列表</li>
                    <li data-path="add_user.html">添加用户</li>
                    <li>修改密码</li>
                </ul>
                <h1>商品信息管理</h1>
                <ul>
                    <li>商品信息列表</li>
                    <li>新增商品</li>
                    <li>修改商品</li>
                </ul>
            </div>
            <div id="list">
                <iframe id="target" src="./users_list.html" width="100%" height="100%" frameborder="0"></iframe>
            </div>
        </div>
    </div>

</body>
<script src="js/jquery.min.js"></script>
<script>
    (() => {

        //设置高度
        let iHeight = $(window).outerHeight() - 50;
        $('#content').height(iHeight);


        $('#menu').on('click', 'li', function () {
            let path = $(this).data('path');
            console.log(path);
            $('#target').attr('src', path);
        });
    })();
</script>

</html>